home *** CD-ROM | disk | FTP | other *** search
/ Chip 2006 December / chip-cd_2006_12.zip / 12 / Pakiet internetowy / Menedzery hasel / PasswordManagerXP 2.2.360 / PwdManager-Setup.exe / mozilla / pwdmgrxpOverlay.js < prev    next >
Text File  |  2006-04-18  |  1KB  |  46 lines

  1. const LoaderExe = "";
  2. const PmXp_cid = "@cp-lab.com/PasswordManagerXP/Extension;1";
  3. try {
  4.     PmXp_obj = Components.classes[PmXp_cid].createInstance();
  5.     PmXp_obj = PmXp_obj.QueryInterface(Components.interfaces.IPmXpExtension);
  6.     PmXp_obj.SetLoaderExe(LoaderExe);
  7. } catch (err) {
  8.     alert(err);
  9. }
  10.  
  11. window.addEventListener("load", PmXp_initOverlay, false);
  12. window.addEventListener('submit', PmXp_SubmitHandler, true);
  13.  
  14. HTMLFormElement.prototype.PmXp_OldSubmitHandler = HTMLFormElement.prototype.submit;
  15. HTMLFormElement.prototype.submit = PmXp_SubmitHandler;
  16.  
  17. function PmXp_Action(act_no)
  18. {
  19.     try {
  20.         PmXp_obj.DoAction(act_no);
  21.     } catch (err) {
  22.         alert(err);
  23.     }
  24. }
  25.  
  26. function PmXp_contextPopupShowing()
  27. {
  28.   var v = gContextMenu.isTargetATextBox(gContextMenu.target);
  29.   gContextMenu.showItem("pmxp-FillForm", v);
  30.   gContextMenu.showItem("pmxp-SaveForm", v);
  31.   gContextMenu.showItem("pmxp-GenPassword", v);
  32.   gContextMenu.showItem("pmxp-separator1", v && gContextMenu.shouldShowSeparator("pmxp-separator1"));
  33.   gContextMenu.showItem("pmxp-separator2", v && gContextMenu.shouldShowSeparator("pmxp-separator2"));
  34. }
  35.  
  36. function PmXp_initOverlay()
  37. {
  38.   var menu = document.getElementById("contentAreaContextMenu");
  39.   menu.addEventListener("popupshowing", PmXp_contextPopupShowing, false);
  40. }
  41.  
  42. function PmXp_SubmitHandler(event) {
  43.   PmXp_Action(6);
  44.   this.PmXp_OldSubmitHandler();
  45. }
  46.